package tests;

import main.*;
import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;

public class OperationTest {
	Operation ex;

	@Before
	public void init() {
		ex = new Times(
				new Minus(
					new Plus(5, 3), 
					new Times(
						new MyNumber(8), 
						new Minus(7, 6))), 
				new MyNumber(2));
	}

	@Test
	public void numbers() {
		assertEquals(6, ex.countNbs());
	}

	@Test
	public void depth() {
		assertEquals(4, ex.countDepth());
	}

	@Test
	public void operations() {
		assertEquals(5, ex.countOps());
	}
}
